﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace OpenSearch.Client.Util
{
    public class SearchSuggestion
    {
        public string Text { get; private set; }
        public Uri Image { get; private set; }
        public string ImageAlt { get; set; }
        public int Height { get; private set; }
        public int Width { get; private set; }

        public bool HasImage { get { return Image != null; } }

        public SearchSuggestion(string text)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(text));
            Text = text;
        }

        public SearchSuggestion(string text, Uri image, string imageAlt, int height, int width)
            : this(text)
        {
            Image = image;
            ImageAlt = imageAlt;
            Height = height;
            Width = width;
        }

        public override string ToString()
        {
            return Text;
        }
    }
}
